package com.mall.user.domain.model;

public record PromotionTitle(String title) {
    public PromotionTitle {
        //标题长度不能超过十个字符
        if (title.length() > 10) {
            throw new IllegalArgumentException("标题长度不能超过十个字符");
        }
    }

    public static PromotionTitle of(String title) {
        return new PromotionTitle(title);
    }
}
